import Mock from 'mockjs'

const count = 20;

const List = [];

for (let i = 0; i < count; i++) {
  List.push(Mock.mock({
    'id|1': '@increment',
    'noteId|1': '@increment',
    betTime: +Mock.Random.date('T'),
    username: '@first',
    agencyName: '@first',
    platformUsername: '@first',
    'platform|1': _.map(consts.PLATFORM_TYPE, 'value'),
    'subGame|1': ['阿拉', 'sdj', '就是', '水电费'],
    'betContent|1': ['safjsdlfjs', 'sfslkfajsdj', 'sdfjlsdjflsdj', 'sfjksdlfj'],
    'noteStatus|1': _.map(consts.NOTE_STATUS, 'value'),

    'betMoney|10000-10000000': 10000000,
    'payoutMoney|10000-10000000': 10000000,
    'profitMoney|10000-10000000': 10000000,
    'effectiveMoney|10000-10000000': 10000000,
  }))
}

let GameList = [];

GameList = [
  {
    platformId: 1,
    createTime: +Mock.Random.date('T'),
    updateTime: +Mock.Random.date('T'),
    status: true,
    maintainStartTime: +Mock.Random.date('T'),
    maintainEndTime: +Mock.Random.date('T'),
    maintainReason: Mock.Random.ctitle(0, 20),
  },
  {
    platformId: 2,
    createTime: +Mock.Random.date('T'),
    updateTime: +Mock.Random.date('T'),
    status: true,
    maintainStartTime: +Mock.Random.date('T'),
    maintainEndTime: +Mock.Random.date('T'),
    maintainReason: Mock.Random.ctitle(0, 20),
  },
  {
    platformId: 3,
    createTime: +Mock.Random.date('T'),
    updateTime: +Mock.Random.date('T'),
    status: true,
    maintainStartTime: +Mock.Random.date('T'),
    maintainEndTime: +Mock.Random.date('T'),
    maintainReason: Mock.Random.ctitle(0, 20),
  },
  {
    platformId: 4,
    createTime: +Mock.Random.date('T'),
    updateTime: +Mock.Random.date('T'),
    status: false,
    maintainStartTime: +Mock.Random.date('T'),
    maintainEndTime: +Mock.Random.date('T'),
    maintainReason: Mock.Random.ctitle(0, 20),
  },
  {
    platformId: 5,
    createTime: +Mock.Random.date('T'),
    updateTime: +Mock.Random.date('T'),
    status: true,
    maintainStartTime: undefined,
    maintainEndTime: undefined,
    maintainReason: undefined,
  },
];

const SubGameList = [];

for (let i = 0; i < count; i++) {
  SubGameList.push(Mock.mock({
    'gameId|1': '@increment',
    'gameName|1': ['游戏居然', '弹弹乐', '奖金巨人'],
    'type|1': _.map(consts.DIGITAL_GAME_TYPE, 'value'),
    'pic': Mock.Random.image('200x100'),
    status: true,
    createTime: +Mock.Random.date('T'),
    updateTime: +Mock.Random.date('T'),
    sort: 2,
  }))
}

export default {
  [api.GAME_MANAGER_LIST]:
    () => ({
      code: 1,
      data: {
        total: GameList.length,
        items: GameList
      },
    }),

  [api.GAME_MANAGER_SUB_LIST]:
    () => ({
      code: 1,
      data: {
        total: SubGameList.length,
        items: SubGameList
      },
    }),

  [api.GAME_STATISTIC_LIST]:
    () => ({
      code: 1,
      data: {
        total: List.length,
        items: List
      },
    }),
}
